package com.blb.zy_community.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.zy_community.entity.ZyUnit;
import com.blb.zy_community.mapper.ZyUnitMapper;
import com.blb.zy_community.service.IZyUnitService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 单元  服务实现类
 * </p>
 *
 * @author 二组
 * @since 2023-06-18
 */
@Service
public class ZyUnitServiceImpl extends ServiceImpl<ZyUnitMapper, ZyUnit> implements IZyUnitService {
    @Autowired
    private ZyUnitMapper zyUnitMapper;
    @Override
    public Page<ZyUnit> getByUnit(Long current, Long size, String unitName, String unitCode, String unitHaveElevator, String buildingId,Long communityId) {
        return zyUnitMapper.selectZyUnit(new Page<>(current,size), unitName,unitCode,unitHaveElevator,buildingId,communityId);
    }

    @Override
    public void deleteUnit(Long[] unitIds) {
        zyUnitMapper.deleteUnit(unitIds);
    }
}
